package lab01;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/12/26.
 */
public class Test08_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入1--100之间的数字   i=");
        int j = (int) (Math.random() * 100) + 1;
        System.out.println(j);
        while (true) {
            int i = scanner.nextInt();
            if (i < j) System.out.println("猜小了");
            else if (i > j) System.out.println("猜大了");
            else {System.out.println("猜对了");
            break;}
        }
    }
}
